#include "datetimethread.h"
#include <QThread>
#include <QDebug>

DateTimeThread::DateTimeThread(QObject *parent)
    : QObject{parent}
{
    m_bisStart = false;
}

void DateTimeThread::setFlag(bool flag)
{
    m_bisStart = flag;
}

void DateTimeThread::ThreadRun()
{
    while(m_bisStart == true)
    {
        QDateTime curDateTime = QDateTime::currentDateTime();
        //qDebug() << curDateTime;
        emit SendDateInfo(curDateTime);
        QThread::msleep(3);

        if(m_bisStart == false)
        {
            break;
        }
    }
}
